﻿/*
 * @Autor: PK
 * @Date: 2021/12/12 19:58:SS
 */

using System;
using ShkSimulation.core.dao.statistic;

namespace ShkSimulation.core.dao.output.result {

	public class DefaultDoubleResult: Result{
		
		protected ResultData dataDictionary;
		protected string uniqueKey;

		public DefaultDoubleResult(string uniqueKey, ResultData dataDictionary = null) {
			this.dataDictionary = dataDictionary ?? new ResultData();
			this.uniqueKey = uniqueKey ?? throw new ArgumentNullException(nameof(uniqueKey));
		}

		public string Uniquekey => uniqueKey;

		public ResultData TakeOutputData() {
			return dataDictionary;
		}

		public bool ContainsData(string key) {
			return dataDictionary.ContainsKey(key);
		}
		
		public CollectionReportData GetData(string key) {
			return dataDictionary[key];
		}

		public void AppendData(string key, CollectionReportData appendData) {
			dataDictionary[key] = appendData;
		}

	}
}